package com.hxalex.simulationhandle.ui.home.model;

import com.hxalex.simulationhandle.common.BaseModel;
import com.hxalex.simulationhandle.db.DaoSession;
import com.hxalex.simulationhandle.db.WebSiteBeanDao;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Keep;
import org.greenrobot.greendao.annotation.ToOne;

import java.io.Serializable;
import com.hxalex.simulationhandle.db.TaskBeanDao;

/**
 * Created by hx_Alex on 2018/5/22.
 * 网站库实体
 */
@Entity
public class WebSiteBean extends BaseModel implements Serializable {
    private static final long serialVersionUID = 2552429215424205491L;
    @Id(autoincrement = true)
    private Long webSiteId;
    private String WebSiteString;
    private Long taskId;
    @ToOne(joinProperty = "taskId")
    private TaskBean taskBean;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 1553604830)
    private transient WebSiteBeanDao myDao;

    @Generated(hash = 1735648601)
    public WebSiteBean(Long webSiteId, String WebSiteString, Long taskId) {
        this.webSiteId = webSiteId;
        this.WebSiteString = WebSiteString;
        this.taskId = taskId;
    }

    public WebSiteBean(String WebSiteString) {
        this.WebSiteString = WebSiteString;
    }


    @Generated(hash = 1294784991)
    public WebSiteBean() {
    }

    @Generated(hash = 823051443)
    private transient Long taskBean__resolvedKey;

    public Long getWebSiteId() {
        return webSiteId;
    }

    public void setWebSiteId(Long webSiteId) {
        this.webSiteId = webSiteId;
    }

    public String getWebSiteString() {
        return WebSiteString;
    }

    public void setWebSiteString(String webSiteString) {
        WebSiteString = webSiteString;
    }
    @Keep
    public TaskBean getTaskBean() {
        return taskBean;
    }
    @Keep
    public void setTaskBean(TaskBean taskBean) {
        this.taskBean = taskBean;
    }

    public Long getTaskId() {
        return taskId;
    }

    public void setTaskId(Long taskId) {
        this.taskId = taskId;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1086713962)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getWebSiteBeanDao() : null;
    }
}
